<?php
/**
 * Created by PhpStorm.
 * User: jimmy
 * Date: 2018/8/15
 * Time: 下午4:05
 */

use think\facade\Url;
if (!function_exists('url2')) {
    /**
     * Url生成
     * @param string        $url 路由地址
     * @param string|array  $vars 变量
     * @param bool|string   $suffix 生成的URL后缀
     * @param bool|string   $domain 域名
     * @return string
     */
    function url2($url = '', $vars = '', $suffix = true, $domain = false)
    {

        $url = Url::build($url, $vars, $suffix, $domain);
        $url = str_replace('/admin.php','',$url);
        return $url;

    }
}
